package cn.cstech.aijia.ui.base.title;

import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
import android.widget.RelativeLayout;

public abstract class BaseContentView extends RelativeLayout implements
		IActionTitleBar {

	protected Context mContext;
	protected View mRootView;

	public BaseContentView(Context context) {
		super(context);
		initView(context);
	}

	public BaseContentView(Context context, AttributeSet attrs) {
		this(context, attrs, 0);
	}

	public BaseContentView(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
		initView(context);
	}

	private void initView(Context ctx) {
		Log.d("wyg", "initView---------->>");
		mContext = ctx;
		mRootView = inflate(mContext, onContentLayout(), this);
		onContentViewCreate(mRootView);
		Log.d("wyg", "initView---end------->>");
	}

	public abstract void setMainContentView(View view);

	public abstract int onContentLayout();

	public abstract void onContentViewCreate(View view);

	public void setTitleText(String title) {
		throw new UnsupportedOperationException("");
	}

	public void setTitleText(int title) {
		throw new UnsupportedOperationException("");
	}

	public void setLeftButton(String btnText, View.OnClickListener lsn) {
		throw new UnsupportedOperationException("");
	}

	public void setLeftButton(int btnText, View.OnClickListener lsn) {
		throw new UnsupportedOperationException("");
	}

	public void setLeftImageView(int imageRes, View.OnClickListener lsn) {
		throw new UnsupportedOperationException("");
	}

	public void setRightButton(String btnText, View.OnClickListener lsn) {
		throw new UnsupportedOperationException("");
	}

	public void hideRightButton() {
		throw new UnsupportedOperationException("");
	}

	public void showTitleBar(boolean show) {
		throw new UnsupportedOperationException("");
	}

	public void setRightButton(int btnText, View.OnClickListener lsn) {
		throw new UnsupportedOperationException("");
	}

	public void setRightImageView(int imageRes, View.OnClickListener lsn) {
		throw new UnsupportedOperationException("");
	}

	public void showErrorView(ErrorType type) {
		throw new UnsupportedOperationException("");
	}

	public void showErrorView(ErrorType type, String alertText,
			View.OnClickListener lsn) {
		throw new UnsupportedOperationException("");
	}

	public void showErrorView(ErrorType type, int iconRes, String alertText,
			View.OnClickListener lsn) {
		throw new UnsupportedOperationException("");
	}

	public void hideErrorView() {
		throw new UnsupportedOperationException("");
	}

	public void setDefaultBackActoin(OnClickListener lsn) {
		throw new UnsupportedOperationException("");
	}

	@Override
	public void showCloseButton(boolean show, OnClickListener lsn) {
		throw new UnsupportedOperationException("");
	}

}
